package com.example.banksys;

import javafx.beans.property.*;
import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleStringProperty;

/********************************************************************
 * 为了能够在表格中实现数据显示与绑定，必须将每一行实例化成一类对象
 * 本类是对管理人员窗口下的employee查询功能的表格的行进行实例化
 ********************************************************************/
public class EmployeeEntity {

    //对应于每个列，创建相应的属性

    private final SimpleLongProperty employeeID;
    private final SimpleStringProperty organization;
    private final SimpleStringProperty department;
    private final SimpleStringProperty type;

    private final SimpleStringProperty name;
    //这里第五列本应当是一个按钮，但是似乎并不太需要，反而是将这个employee实体放入第五列的构造中去

    //构造方法必须搞定，否则会因为没分配空间报错

    public EmployeeEntity(){
        employeeID=new SimpleLongProperty();
        organization=new SimpleStringProperty();
        department=new SimpleStringProperty();
        type=new SimpleStringProperty();
        name=new SimpleStringProperty();
    }

    public void setType(String type) {
        this.type.set(type);
    }

    public void setDepartment(String department) {
        this.department.set(department);
    }

    public void setEmployeeID(long employeeID) {
        this.employeeID.set(employeeID);
    }

    public void setOrganization(String organization) {
        this.organization.set(organization);
    }

    public SimpleStringProperty getType() {
        return type;
    }

    public SimpleLongProperty getEmployeeID() {
        return employeeID;
    }

    public SimpleStringProperty getDepartment() {
        return department;
    }

    public SimpleStringProperty getOrganization() {
        return organization;
    }

    public SimpleStringProperty getName() {
        return name;
    }

    public void setName(String name){
        this.name.set(name);
    }
}
